/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import entity.xml.EMessaggio;
import entity.xml.EUtente;
import foundation.FMessaggi;
import foundation.FUtenti;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import presentation.proportional.PBacheca;
import presentation.proportional.gui;

/**
 *
 * @author Ennio
 */
public class CGestioneRubrica {
    
    private static CGestioneRubrica istance= null;
    
    private CGestioneRubrica(){
        
    }
    
    public static CGestioneRubrica getIstance(){
        
        if(istance==null) istance= new CGestioneRubrica();
        return istance;
        
    }
    
    public ArrayList<EUtente> getRubricaByUser(EUtente eu){
        return eu.getRubrica();
    }
    
    public EUtente getContactBacheca(String clickedUser){
        EUtente eu= new EUtente();
        eu= FUtenti.getIstance().getUserByNickname(clickedUser);
        return eu;
    }
    
    public void openBachecaContact(EUtente euser){
        
       PBacheca.getInstance().refreshPanel(euser);
       gui.getIstance().buttonClicked(gui._vaiBachecaContatto);
        
    }
    
}
